package generatedClasses;

public class webXmlCreator
{
  protected static String nl;
  public static synchronized webXmlCreator create(String lineSeparator)
  {
    nl = lineSeparator;
    webXmlCreator result = new webXmlCreator();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = NL;
  protected final String TEXT_3 = NL;
  protected final String TEXT_4 = NL;
  protected final String TEXT_5 = NL;
  protected final String TEXT_6 = NL;
  protected final String TEXT_7 = NL;
  protected final String TEXT_8 = NL;
  protected final String TEXT_9 = NL;
  protected final String TEXT_10 = NL;
  protected final String TEXT_11 = NL;
  protected final String TEXT_12 = NL;
  protected final String TEXT_13 = NL;
  protected final String TEXT_14 = NL;
  protected final String TEXT_15 = NL;
  protected final String TEXT_16 = NL;
  protected final String TEXT_17 = " ";
  protected final String TEXT_18 = NL;
  protected final String TEXT_19 = " ";
  protected final String TEXT_20 = NL;
  protected final String TEXT_21 = NL;
  protected final String TEXT_22 = NL;
  protected final String TEXT_23 = NL;
  protected final String TEXT_24 = NL;
  protected final String TEXT_25 = NL;
  protected final String TEXT_26 = NL;
  protected final String TEXT_27 = NL;
  protected final String TEXT_28 = NL;
  protected final String TEXT_29 = NL;
  protected final String TEXT_30 = NL;
  protected final String TEXT_31 = NL;
  protected final String TEXT_32 = NL;
  protected final String TEXT_33 = NL;
  protected final String TEXT_34 = NL;
  protected final String TEXT_35 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    stringBuffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    stringBuffer.append(TEXT_2);
    stringBuffer.append("<web-app xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" id=\"WebApp_ID\" version=\"2.5\">");
    stringBuffer.append(TEXT_3);
    stringBuffer.append("  <display-name>TutorialStruts</display-name>");
    stringBuffer.append(TEXT_4);
    stringBuffer.append("  <welcome-file-list>");
    stringBuffer.append(TEXT_5);
    stringBuffer.append("    <welcome-file>pages/main.jsp</welcome-file>");
    stringBuffer.append(TEXT_6);
    stringBuffer.append("  </welcome-file-list>");
    stringBuffer.append(TEXT_7);
    stringBuffer.append("    <!-- Configuration de l'action servlet -->");
    stringBuffer.append(TEXT_8);
    stringBuffer.append("  <servlet>");
    stringBuffer.append(TEXT_9);
    stringBuffer.append("    <servlet-name>action</servlet-name>");
    stringBuffer.append(TEXT_10);
    stringBuffer.append("    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>");
    stringBuffer.append(TEXT_11);
    stringBuffer.append("    <init-param>");
    stringBuffer.append(TEXT_12);
    stringBuffer.append("      <param-name>config</param-name>");
    stringBuffer.append(TEXT_13);
    stringBuffer.append("      <param-value>/WEB-INF/struts-config.xml</param-value>");
    stringBuffer.append(TEXT_14);
    stringBuffer.append("    </init-param>");
    stringBuffer.append(TEXT_15);
    stringBuffer.append("    <!-- The below example tells the container that the servlet will be loaded at first.");
    stringBuffer.append(TEXT_16);
    stringBuffer.append("    The <load-on-startup> sub-element indicates the order in which each servlet should be loaded.");
    stringBuffer.append(TEXT_17);
    stringBuffer.append(TEXT_18);
    stringBuffer.append("    Lower positive values are loaded first. If the value is negative or unspecified,");
    stringBuffer.append(TEXT_19);
    stringBuffer.append(TEXT_20);
    stringBuffer.append("    then the container can load the servlet at anytime during startup -->");
    stringBuffer.append(TEXT_21);
    stringBuffer.append("    <load-on-startup>1</load-on-startup>");
    stringBuffer.append(TEXT_22);
    stringBuffer.append("  </servlet>");
    stringBuffer.append(TEXT_23);
    stringBuffer.append("  <!-- Action Servlet Mapping -->");
    stringBuffer.append(TEXT_24);
    stringBuffer.append("	<servlet-mapping>");
    stringBuffer.append(TEXT_25);
    stringBuffer.append("		<servlet-name>action</servlet-name>");
    stringBuffer.append(TEXT_26);
    stringBuffer.append("		<url-pattern>*.do</url-pattern>");
    stringBuffer.append(TEXT_27);
    stringBuffer.append("	</servlet-mapping>");
    stringBuffer.append(TEXT_28);
    stringBuffer.append("		<!-- declaring a JDBC data source -->");
    stringBuffer.append(TEXT_29);
    stringBuffer.append("	<resource-ref>");
    stringBuffer.append(TEXT_30);
    stringBuffer.append("		<description>JDBC resource to access my DB i.e. dfj_hibernate</description>");
    stringBuffer.append(TEXT_31);
    stringBuffer.append("		<res-ref-name>jdbc/dsMyDB</res-ref-name>");
    stringBuffer.append(TEXT_32);
    stringBuffer.append("		<res-type>javax.sql.DataSource</res-type>");
    stringBuffer.append(TEXT_33);
    stringBuffer.append("		<res-auth>Container</res-auth>");
    stringBuffer.append(TEXT_34);
    stringBuffer.append("	</resource-ref>");
    stringBuffer.append(TEXT_35);
    stringBuffer.append("</web-app>");
    return stringBuffer.toString();
  }
}
